package org.example.lanchain.tools;

import dev.langchain4j.agent.tool.Tool;
import org.springframework.stereotype.Component;

@Component
public class CalculatorTools {

    @Tool(name = "加法运算", value = "传入两个参数进行加法运算")
    double sum(double a, double b) {
        System.out.println("调用加法");
        return a + b;
    }

    @Tool(name = "平方根运算", value = "传入一个参数进行平方根运算")
    double squareRoot(double a) {
        System.out.println("调用平方根");
        return Math.sqrt(a);
    }

}
